<template>
  <div class="child">
    <h1>mitt的ChildOne组件</h1>
    <h1>ChildOne的toy:{{ toy }}</h1>
    <!-- ChildOne调用函数，所以把数据当参数传过去，谁调用，谁是传参的人 -->
	<button @click="emitter.emit('send-toy',toy)">调用ChildTwo监听的函数</button>
  </div>
</template>

<script lang="ts" setup>
    import useChildComponent from '@/hooks/useChildComponent';
    const { toy } = useChildComponent()
    import emitter from '@/utils/emitter';
</script>

<style scoped>
</style>